package com;
import java.sql.*;
import com.tool.*;
public class users {
    private String username;
    private String pasword;
    private String email;
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPasword() {
        return pasword;
    }
    public void setPasword(String pasword) {
        this.pasword = pasword;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public users() {
    }
    public users(String username, String pasword, String email) {
        this.username = username;
        this.pasword = pasword;
        this.email = email;
    }
    public void save(){
        Connection connection=null;
        PreparedStatement statement=null;
        ResultSet resultSet=null;
        try {
            connection= tooljdbc.getconnect();
            statement=connection.prepareStatement
                    ("insert into `users`(`username`,`password`,`email`)values(?,?,?)");
            statement.setString(1,username);
            statement.setString(2,pasword);
            statement.setString(3,email);
            statement.executeUpdate();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            tooljdbc.close(connection,statement,resultSet);
        }
    }
}
